package com.lsx.logistics;

import java.util.Date;
import java.util.Random;
import java.util.Scanner;
import java.util.UUID;

public class IdUtil {
    private static int pre = 100000;

    /**
     * 根据当前时间戳获取6位数的id
     * @return
     */
    public static int getId(){
        int res = pre + 100;
        int random =  (int) (Math.random() * 50);
        System.out.println(random);
        res = res + random;
        pre = res;
        return res;
    }

    /**
     * 生成五位数字+字母组合
     * @return
     */
    public static String getRegistryCode(){
        return UUID.randomUUID().toString().substring(0,6);
    }

    public static void main(String[] args) throws InterruptedException {
        String str = "2020-2-2 12:00:11";
        Long timestamp = Date.parse(str);
        System.out.println(timestamp);

    }
}
